<template>
    <div class="school">
        <h2>学校名称:{{ name }}</h2>
        <h2>学校名称:{{ address }}</h2>
    </div>
</template>

<script>
export default {
    name: "School",
    data() {
        console.log(String)
        return {
            address: "中国",
            myName: this.name // 接收过来的props
        }
    },
    // 现用props的， props定义的， data就不能用
    // props: ["name", "sex", "address"] // 简单接收

    // 接收类型限制
    /*props: {
        name: String,
        age: Number,
        sex: String
    }*/

    props: {
        name: {
            type: String,
            required: true, // name必要的
            default: "冯镠霖"
        }
    }
}
</script>

<style scoped>
.school {
    background-color: aquamarine;
}
</style>